Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: default values would not work for fk_account. #23860

Conversation

thomas-Ngr
Copy link
Contributor

@thomas-Ngr thomas-Ngr commented Feb 9, 2023

Fix : Default value is not used for fk_account on an invoice creation

Current behavior:
On page admin/defaultvalues.php we set this parameter :
image

Problem : it is not used on the compta/facture/card.php page (Compte bancaire).
image

But once we select a thirdparty, the value is set to the account configured on the thirdparty (here CIC).
image

And if the thirdparty does not have an account configured, the account stays blank. The default value is never used.

Expected behavior:

When default value is set for fk_account:

  • on a virgin page, fk_account should not be set.
  • If the page has been reloaded with parameter &socid:
    • if fk_account is defined for thirdparty, use this value
    • else, use the default value by using GETPOST() function.

@thomas-Ngr thomas-Ngr marked this pull request as ready for review February 9, 2023 17:06
eldy added a commit that referenced this pull request Feb 9, 2023
eldy added a commit that referenced this pull request Feb 9, 2023
@thomas-Ngr
Copy link
Contributor Author

Thanks @eldy !

@thomas-Ngr thomas-Ngr closed this Feb 10, 2023
thomas-Ngr pushed a commit to Easya-Solutions/dolibarr that referenced this pull request Feb 14, 2023
thomas-Ngr added a commit to Easya-Solutions/dolibarr that referenced this pull request Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant